package com.pulisher.mapper;

import com.pulisher.bean.CourseSubjectAmountBean;
import com.pulisher.bean.CourseSubjectOrderBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Create 2023/9/11 18:29
 */
public interface CourseStatsMapper {

    //1、各学科下单统计
    @Select("select subject_name,\n" +
            "       sum(user_ct) user_ct,\n" +
            "       sum(order_ct) order_ct,\n" +
            "       sum(order_amount) order_amount\n" +
            "from dws_trade_sub_cate_cou_order_window partition(par${date})\n" +
            "group by subject_name;")
    public List<CourseSubjectOrderBean> selectCourseOrder(@Param("date") String date);

    //1、各学科下单销售额
    @Select("select subject_name,\n" +
            "       sum(order_amount) order_amount\n" +
            "from dws_trade_sub_cate_cou_order_window partition(par${date})\n" +
            "group by subject_name;")
    public List<CourseSubjectAmountBean> selectCourseAmount(@Param("date") String date);

}
